Goes on: Position (duplicate the layer to make a trail)
Each copy follows the layer above it a few frames late. Duplicate it 5 times for an instant trail.

// Follow the Leader — Coherent Motion Expressions · getcoherent.app/resources
// Follows the layer directly above with a delay. Duplicate this layer for a trail.
var delay = 0.06; // seconds behind the leader
var out = value;
if (index > 1) {
  var lead = thisComp.layer(index - 1).transform.position;
  out = add(lead.valueAtTime(time - delay), sub(value, lead.valueAtTime(0)));
}
out
